﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace WxxMail.MVC.YanZheng
{
    public class AnswerIdValidation : ValidationAttribute
    {
        /// <summary>
        /// 自定义服务器端验证
        /// </summary>
        /// <param name="value"></param>
        /// <param name="validationContext"></param>
        /// <returns></returns>
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            if (value == null) // Checking for Empty Value
            {
                return new ValidationResult("Please Provide First Name");
            }
            else
            {
                return ValidationResult.Success;
            }
        }
    }
}